import request from '../utils/request.js'
import MINI_PROGRAM_CONFIG from '../env'

export function sendValidCode(params) {
  return request({
    baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
    url: '/sms/sendCode',
    method: 'post',
    data: params
  })
}


export function listByKind(params) {
  return request({
    baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
    url: '/dict/listByKind',
    method: 'get',
    data: { dictKind: params },
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

export function areaList(params) {
 return request({
   baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
   url: '/area/areaList',
   method: 'get',
   data: params
 })
}

// 分类检索
export function findByPCateId(params) {
  return request({
    baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
    url: '/category/findByPCateId',
    method: 'post',
    data: params,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

// 分类检索
export function getSearchCondition(params) {
  return request({
    baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
    url: '/search/getSearchCondition',
    method: 'post',
    data: { searchBizTypeEnum: params },
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

// 标签
export function findColumnList(params) {
  return request({
    baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
    url: '/tags/findColumnList',
    method: 'post',
    data: params
  })
}

// 广告
export function pageAdvert(params) {
  return request({
    baseUrl: MINI_PROGRAM_CONFIG.BASE_URL,
    url: '/advert/pageAdvert',
    method: 'post',
    data: params
  })
}
